/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package Excepciones;

import org.apache.log4j.FileAppender;
import org.apache.log4j.Level;
import org.apache.log4j.Logger;
import org.apache.log4j.SimpleLayout;
import robot_maker.Manager;

/**
 *
 * @author carlosscipione
 */
public class Sistema {
    
        static Logger logger = Logger.getLogger(Sistema.class);

    
    public static void loggear(int numError, String metodo, String mensaje, 
            Class clase, String tipoExcepcion){

      SimpleLayout layout = new SimpleLayout();

      FileAppender appender = null;
      try {
         appender = new FileAppender(layout,"log.txt",true);
      } catch(Exception e) {}

      logger.addAppender(appender);
      logger.setLevel((Level) Level.DEBUG);
      logger.info("Clase: " + clase.getName() + " | Metodo: " + metodo +
              " | Hora: " + Manager.now() + " | Tipo: " + tipoExcepcion);
      logger.error("#: " + numError + " | " + mensaje);
	}


}
